import request from '@/utils/request'

// 查询保洁、绿化区域：添加保洁计划选择列表
export function listArea(query) {
  return request({
    url: '/module/event/clean/area/list',
    method: 'get',
    params: query
  })
}

// 查询保洁、绿化区域：添加保洁计划选择详细
export function getArea(id) {
  return request({
    url: '/module/event/clean/area/' + id,
    method: 'get'
  })
}

// 新增保洁、绿化区域：添加保洁计划选择
export function addArea(data) {
  return request({
    url: '/module/event/clean/area',
    method: 'post',
    data
  })
}

// 修改保洁、绿化区域：添加保洁计划选择
export function updateArea(data) {
  return request({
    url: '/module/event/clean/area',
    method: 'put',
    data
  })
}

// 删除保洁、绿化区域：添加保洁计划选择
export function delArea(id) {
  return request({
    url: '/module/event/clean/area/' + id,
    method: 'delete'
  })
}

// 导出保洁、绿化区域：添加保洁计划选择
export function exportArea(query) {
  return request({
    url: '/module/event/clean/area/export',
    method: 'get',
    params: query
  })
}

// 修改巡更点状态
export function updateAreaState(id, state,type) {
  const data = {
    id,
    state,
    type
  };
  return request({
    url: '/module/event/patrol/point/updateState',
    method: 'put',
    data
  })
}

// 重置二维码
export function resetQrCode(data) {
  return request({
    url: '/module/event/clean/area/resetQrCode',
    method: 'post',
    data
  })
}
